{extend name="v1/layout/base"}
{block name="content"}
<div class="layui-row layui-col-space15">
  <div class="layui-col-md12">
    <form class="layui-card-body layui-form layui-form-pane">
        <!-- <legend>搜索信息</legend> -->
        <div style="margin: 10px 10px 10px 10px">
          <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
              <form class="layui-form">
                <div class="layui-card-body layui-form layui-form-pane">
                  <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg6">
                      <label class="layui-form-label">筛选月份</label>
                      <div class="layui-input-block">
                        <input type="text" class="layui-input" autocomplete="off" id="search_month" placeholder="请选择筛选月份">
                      </div>
                    </div>
                  </div>
                  <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg6">
                      <label class="layui-form-label">客单价</label>
                      <div class="layui-input-block">
                        <input type="text" class="layui-input" disabled="disabled" value="0" autocomplete="off" id="avg_price" placeholder="请选择筛选月份">
                      </div>
                    </div>
                  </div>
                  <div class="layui-row">
                    <div class="layui-col-xs4">&nbsp;</div>
                    <div class="layui-col-xs4">
                      <button type="button" class="layui-btn layui-btn-normal xk-dosearch">计算<i class="layui-icon"></i></button>
                    </div>
                    <div class="layui-col-xs4">&nbsp;</div>
                  </div>

                </div>
              </form>
            </div>
          </div>
        </div>
    </form>
  </div>
</div>
{/block}
{block name="myScript"}
<script>
  layui.use(['form','laydate'], function() {
    var form = layui.form,
      layer = layui.layer,
      $ = layui.$;
      var laydate = layui.laydate;
      laydate.render({
        elem: '#search_month',
        theme: '#1E9FFF',
        type: 'month',
      });
      $(".xk-dosearch").click(function(){
        var search_month = $("#search_month").val(),
            url = "/{:config('manage.manage_name')}/{:config('manage.version')}/Order/monthAvgPrice";
        https(url,{search_month: search_month},'post',1,'正在参与计算').then(res=>{
            $("#avg_price").val(res.resultData.avg_price);
        })
      })
  });

</script>
{/block}
